package fons.model.ontology;

import fons.model.ontology.interfaces.ContextDependent;

public abstract class AbstractContextDependent implements ContextDependent {
	private final Context context;
	
	public AbstractContextDependent (final Context context) {
		this.context = context;
	}
	
	@Override
	public Context getContext () {
		return this.context;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((context == null) ? 0 : context.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AbstractContextDependent other = (AbstractContextDependent) obj;
		if (context == null) {
			if (other.context != null)
				return false;
		} else if (!context.equals(other.context))
			return false;
		return true;
	}
}
